package com.powernode;

public class ChainLearn {
    public static void main(String[] args) {
        Student student = new Student();
        student.setName("张三").setAge(20).setId(1000).setAddress("上海市");
        System.out.println(student);
//      使用lombok生成链式编程
        System.out.println("-------------");
        Teacher teacher = new Teacher();
        teacher.setName("李四").setAge(30).setId(2000).setAddress("北京市");
        System.out.println(teacher);
        System.out.println("-------------------");
//      使用建造者模式更简单了
        Teacher teacher1 = Teacher.builder().age(30).name("王五").id(3000).address("上海市").build();
        System.out.println(teacher1);
    }
}
